home *** CD-ROM | disk | FTP | other *** search
/ MacSilverWare / macsilverware.iso / Utilities / NumberCrunch 1.41 / help text < prev    next >
Text File  |  1990-10-22  |  14KB  |  153 lines

  1.               NumberCrunch
  2. is a scientific calculator which can
  3.   •  compute  algebraic expressions,
  4.   •  define variables and functions,
  5.   •  graph functions and zoom in on them,
  6.   •  save often used objects to disk,
  7. and generally just crunch an awful lot of numbers.
  8.  
  9. For example, if you type 
  10.        f(y) = y^2 + 1
  11.         a = 3.45e-2
  12.        sin( π/f(2-a)  )
  13. into the parser, then it will respond with
  14.        0.6019925995,
  15. which, of course, is just what you asked for. Simple, isn’t it? 
  16.  
  17. Clicking on any of the tiny icons at the top of the NumberCrunch window will change the display to show (in left-to-right order) 
  18.    • the algebraic expression parser,
  19.    • the object list, 
  20.    • the graph window, 
  21.    • the help window, 
  22.    • the disk Input/Output menu, 
  23.    • and the parameter settings. 
  24. All of these modes and disk IO menu items can also be accessed through the main NumberCrunch menu. Holding the command key  and typing 1, 2, 3, 4, or 6 is another shorthand for flipping between the modes. Each one is described below. (The mode descriptions can also be reached by clicking the appropriate button in the Help Window.)
  25.  
  26. - - -  About  - - - - - - - - - - - - - - - - -
  27.             NumberCrunch        version 1.41
  28.             ©Jim Mahoney        October, 1990
  29.                All Rights Reserved
  30.           written in LightSpeed Pascal™
  31.  
  32. This program is completely free for non-commercial use. You are welcome to use it and give it away, but you may not sell it for a profit. Comments are welcome.  
  33. My address is          PO Box 347
  34.                                Marlboro, VT 05344
  35. (I will mail you a copy of the program, sample files and a Hypercard manual if you send me $17. Of course, if you can read this, you already HAVE the program, so your $17 will mainly get you a copy of the manual and encourage me to write an array-oriented, extendable, fancier version.)
  36.  
  37. - -  The Parse Window  - - - - - - - - - -
  38. This is the heart of NumberCrunch’s calculator. Essentially, you type an algebraic expression to the parser, hit Return or Enter, and the value of the expression is output. Variables and functions can be defined using "=", i.e.
  39.     a = 2/3
  40.     f(x,y) = x sin(y)
  41.  
  42. The syntax for expressions follows the conventions of most common programming languages, with the addition of implicit multiplication. The arithmetic operators are +, -, *, / or ÷, and ** or ^ for raising to a power. Any two variables, numbers, or what-ever without any operation are assumed to be multiplying each other. For example the expressions "3*x", "3x", "3 x", and "3(x)" are all equal to "three times the value of x".
  43.  
  44. Numbers are expressed in the standard SANE format. For example, 4, 2.3356, -.002, 1.2e-6, 10E12, and ∞ are all valid numbers. (Here “∞” just means a number larger than the largest SANE number, about 1e4932.) The grouping symbols |, (, {, [ and ], }, ), | are all recognized, as well as ! (factorial) and the common trig and log functions. A list of all known functions is given in the Object Window.
  45.  
  46. Variables are defined by lines  like 
  47.   a_variable = 5 + 8
  48. after which occurances of the the string “a_variable” will have the value 13. Variable names are not case-sensitive, and may contain up to 35 characters. They cannot begin with a number, so implicit multiplication of variables can be parsed. (This means that '4x' is really '4*x', but 'x4' is a variable name.) Variables can be listed and deleted in the Object Window.
  49.  
  50. Functions are defined by typing things like
  51.   f(a,b,c) = g(a)*(b/c) + the_radius
  52. after which  “f(1,2,x)” is equivalent to “g(1)*(2/x) + the_radius”. Like variables, functions can be listed and deleted from the Object Window. The definition of a function can be seen in the Parser by typing just the name of the function, with no arguments, and hitting return.
  53.  
  54. The parser will try to interpret expression as implicit multiplication if possible. For example, '4(1+3)' will give 16, just like '4*(1+3)' and '(1+3)4'. This can be confusing when variables are used. In particular, 'a'(1+4) can give one of three results: 1) if 'a' is undefined, it gives an error; 2) if 'a' is the name of a function, the function is applied to 5; 3) if 'a' is a variable, the result is a*(1+4).
  55.  
  56. Expressions are parsed when the Return or Enter key is pressed, depending on the value of the settings. The current “line” (or the selected text, if some is selected) is evaluated and the value of the last expression is typed on the next line.  Here a “line” is the text between carriage returns, so the normal Macintosh wrap at the edge of the window is ignored. If several lines are selected, each is evaluated in turn. Shift-Return or CapsLock-Return will not evaluate an expression. Note that unlike the standard Mac convention, selecting text and then hitting return will NOT delete the selected text. Moreover, if Return is hit when the cursor is in the middle of a line, the line will NOT be broken up. (Assuming Return is set to evaluate expressions in the Settings.)
  57.  
  58. All of the standard Cut, Copy, Paste, and Clear commands and their keyboard shortcuts work in the Parser Window. 
  59.  
  60. - - -  The Object Window  - - - - - - - - - -
  61. This window shows a list of all defined variables and functions. The legal primitive functions can also be displayed. Objects (other than the primitive functions) may be deleted by selecting them and then clicking on the delete button.
  62.  
  63. Initially, values for 'e' and 'Pi' are set. Either of these may be deleted or reset. Their values can always be recovered by 'e = exp(1)' and 'Pi = π'. The symbol 'π' (option-p) is always recognized. 
  64.  
  65. - - -  The Graphs Window  - - - - - - - -
  66. This mode is the most complicated of them all. Essentially, you just enter an expression in each of the 6 text windows ('y:', 'x:', and the 4 graph limits) and then click on the Plot button to draw a graph. The 'x:' text must be a variable name, or an error occurs. The plot will show the 'y:' expression evaluated as the 'x:' variable runs from Xmin to Xmax, which are found by evaluating the text in the limits. Any legal expression which evaluates to a constant is OK as a limit. For example, if 'x:' is 'x',  'y:' is 'sin(x)', the Y limits are '1' and '-1', and the X limits are '0' and '2π', then one cycle of the graph of sin(x) vs x will be plotted.
  67.  
  68. When the cursor is over the graph, it appears as a small circle. Holding down the button will then show the co-ordinates of the crosshair. These values are saved as the variables Xclick and Yclick. (The limits of the graph are also saved and are called Xmin, Xmax, Ymin, and Ymax.)
  69.  
  70. More than one function can be plotted by separating them with semi-colons. For example, if 'y:' is 'a + 4x ; sin(x)' , then the line 'a + 4*x' and 'sin(x)' will both be plotted. (Assuming that 'a' is defined. If not, you get an error.)
  71.  
  72. Typing Tab will cycle through the text fields. Shift-Tab will cycle in the other direction, and option-Tab will select all of the current field.
  73.  
  74. The graph limits may also be reset with the mouse. To do this, click on the small button on the left (with the arrows in it). Then either draw a rectangle and click on 'ReSize to Rectangle', or click somewhere to set the zoom point (the cross on the screen) and then zoom In or Out. Note that the ReSize to Rectangle button will exit back to the graph mode (as will the Cancel button), but the zoom In and Out do not. This allows you to zoom in (or out) several times in succession. Each zoom gives 8x magnification.
  75.  
  76. If the limits become so close together that they print out the same (i.e. '.834' for both the min and max of X), then the higher limit will print in the form 'Xmin + 1.2e-5'. Since Xmin is a defined variable, this is a legal expression for a limit.
  77.  
  78. When the size of the window is very small, the limit text may not fit in the fields provided. (For example, you may see X max set to '1.23e' or some such.)  Simply make the window bigger to see all the text.
  79.  
  80. Since the graph is saved as a picture, changing the size of the window can make it look very rough. Just hit the Plot button to draw it again. It is always drawn by evaluating the 'y=' expression every 3 pixels.
  81.  
  82. ---- The Disk Input/Output Menu ----
  83. This pull down menu lets you save or get data in several different formats.
  84.  
  85. The 'Open…', 'Save', and 'Save As…' options all read and write 'Ndoc' files, which can contain text, variables and functions, and the graph. The dialog in Save As determines which of these are saved. When the file is opened, the text and objects (if any) will be appended to the current text and objects, and the graph will replace the current graph.
  86. If some objects are selected in the Object Window, the Save As item will read Save Selected Objects As, and will only save those variables or functions.
  87.  
  88. The 'Save Text…' item will copy the Parser Window to a TEXT file.
  89. This becomes 'Save Selected Text…' if a selection range is active.
  90.  
  91. The 'Insert Text…' choice will read a TEXT file, insert it at the selection point, and select it. To evaluate this text, you then type Return or Enter.
  92.  
  93. The 'Copy Graph' item will put a PICTure of the current graph into the clipboard, where it can be pasted into the Scrapbook for later use. The actual QuickDraw commands are copied, not a bit-map, so the graphs can look pretty nice on a laser printer.
  94.  
  95. The 'Save Defaults' button will write the current environment (as determined in the settings) to a file in the System Folder which is opened whenever the program starts up.
  96.  
  97. - - - The Settings Window  - - - - - - - - - -
  98. This modal dialog allows you to change the settings.
  99.  
  100. The most important is the Default stuff in the top left corner. NumberCrunch tries to read a 'NumberCrunch Defaults' file from the System Folder when it starts up. This file can contain settings, objects, text, graph parameters, and the window position. If the 'Save Now' button is pressed (or Save Defaults chosen from the I/O menu), then the default file will be written (or created) with the current environment. What will be put in (and later read at start-up) depends on the 'Parser', 'Graph', 'Objects', and 'Window Position' check-boxes.
  101.  
  102. If the 'Auto Save' box is checked, then the defaults will be saved whenever the program exits, thus providing a 'continuous memory' between sessions.
  103.  
  104. The check box labeled 'Blink Graph Click Point' will affect what happens when you click in the graph. If this is turned on, then a blinking '+' and its co-ordinates will remain in the graph after you let the mouse up.
  105.  
  106. The 'NumberCrunch Menu' item will put or take out a menu in the main menu bar. All of the items in this menu can be accessed from from the NumberCrunch window; therefore, it is a matter of preference whether this menu exists or not. I think a DA without a menu in the main menu bar is cleaner, but… 
  107.  
  108. Any characters in the 'Prompt' box will be output in the parser window each time an expression is evaluated. They will also be ignored at the start of a line.
  109.  
  110. - - - Bugs - - - - - - - - - - - - - - - - - -
  111. I've fixed most of the obvious ones, but:
  112.   • If there isn't enough memory to create an object or a window, NumberCrunch may not exit gracefully. 
  113.   • If a file cannot be opened (because it has been left open by a system crash, for example) then the program won't open it, but it won't tell you why. Since most errors are reported in the Parser text, I haven't put in any alerts yet (which is where this information should go).
  114.   • I've occasionally seen some conflicts between the host program and the NumberCrunch DA. In particular, the cursor may flicker or not be the right shape.
  115.   • The default file NumberCrunch in the system folder isn't treated exactly the same as the other save files. (The window position is saved, for example.) Occasionally this can lead to problems, for example if you try to save a file named NumberCrunch in the system folder. (The program will create such a file - you don't have to.)
  116.   • For other problems that come up - well, what did you expect from a free program???
  117.  
  118. Fixes :
  119.  --- from version 1.0:
  120.  - File I/0 system crashes
  121.  - Error on stuff after factorial, i.e. 4!/2
  122.  - Occasional crash after recursive function
  123.  
  124.  --- from version 1.2
  125.  - Occasional crash on startup 
  126.      (especially in system 6.0 and higher)
  127.  
  128.  --- from version 1.3
  129.  - Crash in graph after closing during
  130.     blinking click point
  131.  
  132.  --- from version 1.4
  133.  - added Int(x) (integer < x)
  134.  - and Sigma(x) ( 1 if x>0, 0 otherwise) functions
  135.  
  136. - - - More Rambling  - - - - - - - - - - - - - 
  137. I wrote this program partly to see what it would be like to program a Mac, and partly because I didn't like any of the calculator-like programs I'd seen. I use the Mac mostly for numerical research in physics, and want my calculator to know the value of Boltzmann's constant and the speed of light. Now it does.
  138.  
  139. Programming on the Mac turned out to be hard. Not only because of the toolbox and umpty-ump manuals, but because working out a nice interface took much more time and effort than I'd expected.
  140.  
  141. I have plans to make this program into a real scientific computing environment, complete with arrays, matrices, contour plots, imaginary numbers, and hooks to call specialized routines written in Pascal or whatever. We'll see. If you're interested, write me.
  142.          - Jan '89
  143.  -----------------
  144. UPDATE:
  145.  
  146.   I'm still working on NumberCrunch II - the fancy version of NumberCrunch mentioned above. Look for it this soon I hope. I've already put it arrays, units, matrices, complex numbers, multiple windows and files (in the application), externally compiled routines, pascal-like functions and programs, and some little niceties like command-completion. I plan to sell that rather than giving it away, but it should only be $50 or so.
  147. -----------------
  148.  
  149.                      Jim Mahoney
  150.                       10/90
  151.  
  152.  
  153. Oh, and by the way - try clicking somewhere in the help window besides in the buttons, if you haven't already.